package com.tian.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tian.mapper.UserMapper;
import com.tian.po.User;

@Service
public class UserService {
	@Autowired
	private UserMapper userMapper;
	public User getUser(int id){
		try {
			return userMapper.findUserById(id);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return new User();
	}
	public void insertUser(User user){
		userMapper.insertUser(user);
	}
	public void delUser(int id){
		userMapper.delUser(id);
	}
	public void updateUser(User user){
		userMapper.updateUser(user);
	}

}
